package cqrtplm.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigInteger;
import java.util.Date;
import lombok.Data;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * 配置管理-需求状态表-零部件装配bom更改规则表
 * @TableName RT_CFG_BOM_CONFIGURATION
 */
@TableName(value ="RT_CFG_BOM_CONFIGURATION")
@Data
public class RtCfgBomConfigurationDO {
    /**
     * 
     */
    @TableId
    private BigInteger oid;

    /**
     * 生产工厂
     */
    private String productionplant;

    /**
     * 机组机型
     */
    private String unitmodel;

    /**
     * 客户
     */
    private String customer;

    /**
     * 段号
     */
    private String sectionnumber;

    /**
     * 零部件件号前5位
     */
    @Digits(integer = 5, fraction = 0, message = "零部件件号必须为5位数字")
    private String partnumber;

    /**
     * 零部件名称(/代表工段所有)
     */
    private String partname;

    /**
     * MBOM位置(1代表动力 ， 2代表机组)
     */
    private BigInteger mbomlocation;

    /**
     * 
     */
    private Date createtime;

    /**
     * 
     */
    private String createuser;

    /**
     * 
     */
    private BigInteger createuserid;

    /**
     * 
     */
    private Date updatetime;

    /**
     * 
     */
    private String updateuser;

    /**
     * 
     */
    private BigInteger updateuserid;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        RtCfgBomConfigurationDO other = (RtCfgBomConfigurationDO) that;
        return (this.getOid() == null ? other.getOid() == null : this.getOid().equals(other.getOid()))
            && (this.getProductionplant() == null ? other.getProductionplant() == null : this.getProductionplant().equals(other.getProductionplant()))
            && (this.getUnitmodel() == null ? other.getUnitmodel() == null : this.getUnitmodel().equals(other.getUnitmodel()))
            && (this.getCustomer() == null ? other.getCustomer() == null : this.getCustomer().equals(other.getCustomer()))
            && (this.getSectionnumber() == null ? other.getSectionnumber() == null : this.getSectionnumber().equals(other.getSectionnumber()))
            && (this.getPartnumber() == null ? other.getPartnumber() == null : this.getPartnumber().equals(other.getPartnumber()))
            && (this.getPartname() == null ? other.getPartname() == null : this.getPartname().equals(other.getPartname()))
            && (this.getMbomlocation() == null ? other.getMbomlocation() == null : this.getMbomlocation().equals(other.getMbomlocation()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getCreateuser() == null ? other.getCreateuser() == null : this.getCreateuser().equals(other.getCreateuser()))
            && (this.getCreateuserid() == null ? other.getCreateuserid() == null : this.getCreateuserid().equals(other.getCreateuserid()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()))
            && (this.getUpdateuser() == null ? other.getUpdateuser() == null : this.getUpdateuser().equals(other.getUpdateuser()))
            && (this.getUpdateuserid() == null ? other.getUpdateuserid() == null : this.getUpdateuserid().equals(other.getUpdateuserid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOid() == null) ? 0 : getOid().hashCode());
        result = prime * result + ((getProductionplant() == null) ? 0 : getProductionplant().hashCode());
        result = prime * result + ((getUnitmodel() == null) ? 0 : getUnitmodel().hashCode());
        result = prime * result + ((getCustomer() == null) ? 0 : getCustomer().hashCode());
        result = prime * result + ((getSectionnumber() == null) ? 0 : getSectionnumber().hashCode());
        result = prime * result + ((getPartnumber() == null) ? 0 : getPartnumber().hashCode());
        result = prime * result + ((getPartname() == null) ? 0 : getPartname().hashCode());
        result = prime * result + ((getMbomlocation() == null) ? 0 : getMbomlocation().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getCreateuser() == null) ? 0 : getCreateuser().hashCode());
        result = prime * result + ((getCreateuserid() == null) ? 0 : getCreateuserid().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        result = prime * result + ((getUpdateuser() == null) ? 0 : getUpdateuser().hashCode());
        result = prime * result + ((getUpdateuserid() == null) ? 0 : getUpdateuserid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", oid=").append(oid);
        sb.append(", productionplant=").append(productionplant);
        sb.append(", unitmodel=").append(unitmodel);
        sb.append(", customer=").append(customer);
        sb.append(", sectionnumber=").append(sectionnumber);
        sb.append(", partnumber=").append(partnumber);
        sb.append(", partname=").append(partname);
        sb.append(", mbomlocation=").append(mbomlocation);
        sb.append(", createtime=").append(createtime);
        sb.append(", createuser=").append(createuser);
        sb.append(", createuserid=").append(createuserid);
        sb.append(", updatetime=").append(updatetime);
        sb.append(", updateuser=").append(updateuser);
        sb.append(", updateuserid=").append(updateuserid);
        sb.append("]");
        return sb.toString();
    }
}